package cn.com.leon.main;

import cn.com.leon.ui.MainFace;
import java.awt.Image;
import java.awt.Toolkit;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 * 
 * @author Justin
 */
public class Main {

	/**
	 * @param args
	 *            the command line arguments
	 */
	public static File f = new File("./config");
	public static File ff[] = f.listFiles();
	// public static String type[],t;
	public static List<String> type = new ArrayList<String>();

	public static void main(String[] args) {
		for (int i = 0; i < ff.length; i++) {
			type.add(Main.ff[i].getName().substring(0,
					Main.ff[i].getName().lastIndexOf('.')));
		}

		try { // TODO code application logic here
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException ex) {
			Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
		} catch (InstantiationException ex) {
			Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
		} catch (IllegalAccessException ex) {
			Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
		} catch (UnsupportedLookAndFeelException ex) {
			Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
		}
		MainFace m = new MainFace();
		m.setVisible(true);
		m.setTitle("CodeExchange");
		Toolkit kit = Toolkit.getDefaultToolkit();
		Image img = kit.getImage(Thread.currentThread().getClass().getResource(
				"/icon/logo.gif"));
		m.setIconImage(img);
		m.setLocationRelativeTo(null);
	}

}
